import Vue from 'vue'
import Router from 'vue-router'
import Login from "../components/Login.vue";
import StudentRegister from "../components/student/StudentRegister.vue";
import TeacherRegister from "../components/teacher/TeacherRegister.vue";
import Home from "../components/student/Home.vue";
import Courses from "../components/student/Courses.vue";
import Grades from "../components/student/Grades.vue";
import Profile from "../components/student/Profile.vue";
import ChangePassword from "../components/student/ChangePassword.vue";
import StudentHome from "../components/student/StudentHome.vue";
import Logout from "../components/student/Logout.vue";
import TeacherHome from "../components/teacher/TeacherHome.vue";
import AdminHome from "../components/admin/AdminHome.vue";
import HomeContent from "../components/teacher/Home.vue";
import CoursesContent from "../components/teacher/Courses.vue";
import GradesContent from "../components/teacher/Grades.vue";
import ChangePasswordContent from "../components/teacher/ChangePassword.vue";
import TeacherLogout from "../components/teacher/Logout.vue";
import TeacherGradesContent from "../components/teacher/Grades.vue";
import TeacherStudentContent from "../components/teacher/TeacherStudent.vue";
import TeacherCoursesContent from "../components/teacher/Courses.vue";
import StudentData from "../components/teacher/StudentData.vue";
import StudentGrades from "../components/teacher/StudentGrades.vue";
import GradeAnalysis from "../components/teacher/GradeAnalysis.vue";
import AdminAccounts from "../components/admin/AdminAccounts.vue";
import CourseManagement from "../components/admin/CourseManagement.vue";
import TeacherAccounts from "../components/admin/TeacherAccounts.vue";
import StudentAccounts from "../components/admin/StudentAccounts.vue";
import TeacherProfile from "../components/teacher/TeacherProfile.vue";
import AdminProfile from "../components/admin/AdminProfile.vue";
import AdminAccountsHome from "../components/admin/Home.vue" // 解决同名组件问题
import MyCourse from "../components/student/MyCourse.vue"




Vue.use(Router)

function StudentsContent() {

}

export default new Router({
  routes: [
    {path: '/', name: 'Login', component: Login},
    {path: '/student-register', name: 'StudentRegister', component: StudentRegister,},
    {path: '/teacher-register', name: 'TeacherRegister', component: TeacherRegister}, // {
    {path: '/student-home/', name: 'StudentHome', component: StudentHome,redirect: '/student-home/home',
      children: [
        {
          path: 'home',
          name: 'home',
          component: Home
        },
        {
          path: 'courses',
          name: 'courses',
          component: Courses
        },
        { path: 'myCourses', name: 'MyCourse', component: MyCourse }, // 添加 MyCourse 路由
        {
          path: 'grades',
          name: 'grades',
          component: Grades
        },
        {
          path: 'profile',
          name: 'profile',
          component: Profile
        },
        {
          path: 'changePassword',
          name: 'changePassword',
          component: ChangePassword
        },
        {
          path: 'logout',
          name: 'Logout',
          component: Logout
        }
      ]
    },
    {path: '/teacher-home', name: 'TeacherHome', component: TeacherHome, children: [
        {
          path: 'home',
          name: 'TeacherHomeContent',
          component: HomeContent
        },
        {
          path: 'courses',
          name: 'TeacherCoursesContent',
          component: TeacherCoursesContent
        },
        {
          path: 'students',
          name: 'TeacherStudentsContent',
          component: TeacherStudentContent
        },
        {
          path: 'grades',
          name: 'TeacherGradesContent',
          component: GradesContent
        },
        {
          path: 'changePassword',
          name: 'TeacherChangePasswordContent',
          component: ChangePasswordContent
        },
        {
          path: 'logout',
          name: 'TeacherLogout',
          component: TeacherLogout
        },
        {
          path: 'student-data/:id',
          name: 'StudentData',
          component: StudentData
        },
        {
          path: 'student-grades/:id',
          name: 'StudentGrades',
          component: StudentGrades
        },
        {
          path: 'grade-analysis/:id',
          name: 'GradeAnalysis',
          component: GradeAnalysis
        },
        {
          path: 'profile',
          name: 'profile',
          component: TeacherProfile
        },
       ]
    },
    {
      path: '/admin-home', name: 'AdminHome', component: AdminHome, redirect: '/admin-home/home',
      children: [
        {path: 'home',name: 'home',component: AdminAccountsHome},
        { path: 'adminAccounts', name: 'adminAccounts', component: AdminAccounts },
        { path: 'studentAccounts', name: 'studentAccounts', component: StudentAccounts },
        { path: 'teacherAccounts', name: 'teacherAccounts', component: TeacherAccounts },
        { path: 'courseManagement', name: 'courseManagement', component: CourseManagement },
        { path: 'logout', name: 'Logout', component: Logout },
        { path: 'changePassword', name: 'changePassword', component: ChangePassword },
        {path: 'profile', name: 'profile', component: AdminProfile},
      ]
    },

  ]
})
